<template>
  <van-nav-bar
    :title="title"
    :left-text="leftText"
    :left-arrow="leftArrow"
    @click-left="onClickLeft"
  />
</template>

<script>
import { NavBar } from 'vant'

export default {
  name: 'VantNavigationBar',
  components: {
    [NavBar.name]: NavBar,
  },
  props: {
    title: {
      type: String,
      required: true,
    },
    leftText: {
      type: String,
      default: '返回',
    },
    leftArrow: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    onClickLeft() {
      history.back()
    },
  },
}
</script>
